package example_09.demo_02;

public class demo_01 {
    public static void main(String[] args) {
        String str="afafafa";
        String s=str.replaceAll("([a-z]+)\\1+","$1");
        System.out.println(s);
    }
}
